<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>珠峰课堂</title>
</head>
<body>
    <script>
        let docEle = document.documentElement;//获取根元素
        function setRemUnit(){
            //当屏幕的宽度是750px的话,1rem=75px  物理像素 750
            //如果屏幕的宽度是375px的话,1rem=37.5px 2
            //docEle.style.fontSize = '75px';
            docEle.style.fontSize = docEle.clientWidth/10+'px';
        }
        setRemUnit();
        window.addEventListener('resize',setRemUnit);
    </script>
    <div id="root"></div>
</body>
</html>